<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>1744：[Usaco2005 oct]Skiing 奶牛滑雪</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Usaco2005 oct]Skiing 奶牛滑雪</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Usaco2005 oct]Skiing 奶牛滑雪</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Usaco2005 oct]Skiing 奶牛滑雪                </h1>
                <p>时间限制：5s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：64MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p><span style="font-size: medium">Bessie and the rest of Farmer John's cows are taking a trip this winter to go skiing. One day Bessie finds herself at the top left corner of an R (1 &lt;= R &lt;= 100) by C (1 &lt;= C &lt;= 100) grid of elevations E (-25 &lt;= E &lt;= 25). In order to join FJ and the other cows at a discow party, she must get down to the bottom right corner as quickly as she can by travelling only north, south, east, and west. Bessie starts out travelling at a initial speed V (1 &lt;= V &lt;= 1,000,000). She has discovered a remarkable relationship between her speed and her elevation change. When Bessie moves from a location of height A to an adjacent location of height B, her speed is multiplied by the number 2^(A-B). The time it takes Bessie to travel from a location to an adjacent location is the reciprocal of her speed when she is at the first location. Find the both smallest amount of time it will take Bessie to join her cow friends and the number of moves required by the path (a move is a transition from one location to another adjacent location). </span></p>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;贝茜和其他一些人去滑雪．贝茜发现她自己站在一块R x&nbsp;C(1&le;R，C&le;100)的区域中，区域中的每一块都有一个高度值Ei,j．为了参加大家的聚会，贝茜想要尽快到达右下角．</span><span style="font-size: medium">&nbsp;贝茜每一步只能向正东，正西，正南，正北前进一步．贝茜以初速度V(I&le;y&le;106)前</span><span style="font-size: medium">进，她发现了一个她的速度和高度的关系．当贝茜从高度n移动到高度b，她的速度就乘上了一个数2^(a-b)．贝茜移动一步的速度取决于她在前一格时的速度．</span></div>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;请找出贝茜移动所需的最小时间．</span></div></p><hr/><h3>输入格式</h3><p><p><span style="font-size: medium">* Line 1: Three space-separated integers: V, R, and C, which respectively represent Bessie's initial velocity and the number of rows and columns in the grid. </span></p>
<p><span style="font-size: medium">* Lines 2..R+1: C integers representing the elevation E of the corresponding location on the grid. </span></p>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;第1行：3个用空格隔开的整数V，R，C，分别表示贝茜的初速度和区域的长度和宽度．</span></div>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;第2到R+1行：以矩阵的形式表示该区域中各块的高度．</span></div></p><hr/><h3>输出格式</h3><p><p><span style="font-size: medium">A single number value, printed to two exactly decimal places: the minimum amount of time that Bessie can take to reach the bottom right corner of the grid. </span></p>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;输出一个实数（保留2位小数），表示贝茜达到目的地最少需要的时间．</span></div></p><hr/><h3>样例输入</h3><pre>1 3 3  //奶牛开始在左上角，速度为1,它可以移动到别的格子上，速度会发生变化
1 5 3 //这个3*3的数矩阵代表每个格子的参数，当从一个格子A到B时，速度变成V*2^(A-B)
6 3 5
2 4 3
</pre><hr/><h3>样例输出</h3><pre>29.00

OUTPUT DETAILS:

Bessie's best route is:
	Start at 1,1 time  0 speed 1
	East  to 1,2 time  1 speed 1/16
	South to 2,2 time 17 speed 1/4
	South to 3,2 time 21 speed 1/8
	East  to 3,3 time 29 speed 1/4
</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>Gold</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=1744" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=1744" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>